Running from the Command Line

You can run the Bulk Costing and Analysis module from the command line in batch mode, to:

  • Perform a batch cost analysis on many parts at the same time in an automated and scheduled fashion.

  • Use bulk costing for activities like Spend Analytics.

  • Run bulk costing as an offline process.

Costing inputs can be specified through spreadsheets, and cost estimates and related data of interest can be output to spreadsheets. This enables you to interface aPriori with other product lifecycle management systems to support fully automated batch costing. For example, an upstream system may prepare a set of CAD files and a corresponding set of cost inputs to pass to aPriori and initiate a Bulk Costing session; the outputs of the session can then be passed to another downstream system.

Note: If you set bulkLoader.watchpointXlsFile in the properties file, you must also set bulkLoader.rollupName or no report is generated.

bulkLoad.cmd

To run Bulk Costing from the command line, use the bulkLoad.cmd command, from
apriori_install\version\install\bin

This command takes three arguments which must be specified in the exact order shown

Note: Do not map a network drive to the aPriori installation folder and then use that mapped drive when running the bulkLoad command.  Doing so will cause the bulkLoad command to fail with a log entry similar to the following:
RuntimeException executing:Cannot build ClassLoader from dependencies.txt Msg:Cannot find dependencies file:Z:\install-support\antscripts\lib\classpath-win64.txt

Syntax

bulkLoad.cmd props_file [username "password"]

Arguments

props_file: The path to the properties file, which contains the same inputs that are provided via the user interface when running interactively. See bulkLoad.properties file for more information.

Username: The aPriori log-in account name to use for this session.

password: The associated aPriori password.

Note: When an aPriori account password is passed as an input argument to a line utility, as a best practice, wrap the password in quotes.

Note: If username and password are not specified as arguments on the command line, the Bulk Loader looks for them in the properties file. If not found there, and if your aPriori administrator has implemented Single Sign On (SSO), the Bulk Loader attempts to use the currently logged-in user’s Windows credentials.

Example

Create a batch file named bulk.bat with the following contents that makes a call to the bulkLoad.cmd command. (username and password are shown as part of the batch file, but you should consider providing these at run time.

call BulkLoad.cmd C:\Files\bulkLoad.properties myUserName "myPassword"

Forward and back slashes

When using the command line, paths should be specified with Windows backslashes, as you would expect. However, paths specified within properties files must be specified with UNIX-style forward slashes.

The example in the previous section correctly shows the command line using Windows-style back slashes to specify the bulkLoad.properties file. However, any paths within the bulkLoad.properties file must use forward slashes, such as:

bulkLoader.partsDir=C:/BulkLoad_Test/CAD_files

bulkLoad.properties file

The bulkLoad.properties file specifies the predefined bulk costing inputs required by the bulkLoad.cmd command.

aPriori provides a sample file named bulkLoadTemplate.properties at

install\ext\analysis-purchasing-module\command-line\

Note: Paths specified within this file must use UNIX-style forward slashes. In addition, you can add entries from the apriori.properties and the bulk loader plugin.properties which will override the values set in those files. Note that paths specified within these files must use UNIX-style forward slashes.

Properties file entries

Corresponding

User Interface Field or Item

Notes

bulkLoader.name=

Name

 

bulkLoader.partsDir=<directory of parts>

Directory

This property and any other path properties in this file must be specified with UNIX-style forward slashes, such as C:/BulkLoad_Test/CAD_files

bulkLoader.inputsFile=<input excel file>

Inputs File

Optional argument

bulkLoader.rollupName=<name of Rollup>

Rollup Name

 

No report is generated, if not specified when bulkLoader.watchpointXlsFile is set.

Otherwise, optional argument.

bulkLoader.processingInputRule=<update|skip|create_new_scenario|clear_existing>

Processing rule if scenario exists

 

  • Dropdown box

  • Optional argument

bulkLoader.active=<yes|no>

Active

  • Accepts yes|no values.

  • Does not accept true|false values.

  • Optional argument.

bulkLoader.official=<yes|no>

Official field

 

  • Accepts yes|no values.

  • Does not accept true|false values.

  • Optional argument.

bulkLoader.onlyCostSpreadsheetComponents=<true/false>

Only cost components in spreadsheet

bulkLoader.defaultProcessGroup=
<default process group name>

Default Part Process Group

bulkLoader.defaultPartDigitalFactory=<default part digital factory>

Default Part Digital Factory

bulkLoader.defaultAssemblyVpe=
<default assembly digital factory>

Default Assembly Digital Factory

bulkLoader.description=<text>

Description

  • Optional argument

bulkLoader.username=<username>

Username

  • aPriori login username.

  • Required for non-single-sign-on (SSO) enabled installations if p is not entered on the command line.

  • Optional for SSO-enabled installations. Leave username blank to have the Bulk Loader job run under the Windows username and password.

bulkLoader.password=<password>

Password

  • aPriori login password.

  • Required for non-single-sign-on (SSO) enabled installations if password is not entered on the command line.

  • Optional for SSO-enabled installations. Leave password blank to have the Bulk Loader job run under the Windows username and password.

bulkLoader.deployment=<deployment>

Deployment Name

Name of the deployment that you want to connect to.

bulkLoader.schemaname=<schemaname>

Schema Name

Point to the component schema associated with the deployment you specified above.  The schema must be configured in the aPriori database.

bulkLoader.xmlFile=
<previously exported bulk loader XML file>

Open Loader File

  • To use an existing bulk loader file, specify the file name.

  • Otherwise, optional argument

bulkLoader.watchpointXmlFile=
<watchpoint input file>

Watchpoint input file path and name

 

  • To use a watchpoint input file, specify the path and file name. Otherwise, optional entry.

bulkLoader.watchpointXlsFile=
<watchpoint output spreadsheet>

Watchpoint output report file name

 

  • To use a watchpoint output report file, specify the path and file name. Otherwise, optional entry.

  • Note: If you property, you must also set bulkLoader.rollupName or no report is generated.

  • Otherwise, optional entry.

plugin.properties file

The Bulk Loader plugin.properties file is found in install\ext\analysis-purchasing-module and affects both command line and UI-based  Bulk Costing.

Although most of the settings in this properties file are documented by comments, you should not change this file without the assistance of aPriori Customer Support.

To ensure that child processes cannot cause the parent bulk load process to hang, bulkload.batch.size has a default value of "50" (formerly "0").

The value is used in this calculation:

maxBatchSize * launcher.cost.timeout.seconds + 15 mins

If this value is exceeded, the parent bulk loader process kills any child process and aPriori notifies you with a message :

You can uncomment bulkload.batch.size and set it to a positive value but a value of "0" is not supported.

The Bulk Loader plugin.properties file contains a new property named bulkload.rmi.port (default value "1099") This is a unique port number that the Bulk Loader uses to communicate with its children processes. Don't change it unless you are running two instances of Bulk Loader concurrently on the same machine, or the default port (1099) is already in use. You can also control cache cleaning behavior from this file. See the note in the table "Summary of aPriori Properties" in the System Administration Guide for more information.